import { getHotel } from "@/utils/api";
//住宿
const hotel = {
  namespaced: true,
  state: () => ({
    hotelMainList: [], //主数据
  }),
  actions: {
    //获取住宿主数据
    async hotelData({ commit }) {
      let res = await getHotel();
      commit("hotelDatas", res.data);
    },
  },
  mutations: {
    //获得并存储住宿数据
    hotelDatas(state, payload) {
      state.hotelMainList = payload;
    },
  },
};

export default hotel;
